import { $get } from '@js/request'
import { CaseSchema } from '@src/components/schema/caseSchema';
import { RoomSchema } from '@src/components/schema/room';

export async function getCaseListRequsest (v: string, id: string): Promise<CaseSchema[]> {
  const res = await $get('/api/commission/case', {
    condition: JSON.stringify([{ k: 'caseno_desc', o: 'like', v: `%${v}%` }, { k: 'processerid', o: '=', v: `${id}` }])
  })
  return res.data.list
}

export async function getRoomListRequest (): Promise<RoomSchema[]> {
  const res = await $get('/api/commission/hearingroom/getHearingroomCloud')
  return res.data
}

export async function getRecorderRequest (): Promise<Array<{ name: string, accountid: string }>> {
  const res = await $get('/api/common/employee/getByRoleKeys', {
    rolekeys: 'recorder'
  })
  return res.data
}

